# Maintainer: BlackEagle <ike.devolder@gmail.com>>

pkgname=kodi-addon-audioencoder-flac
epoch=1
pkgver=20.2.0
_codename=Nexus
pkgrel=4
pkgdesc="FLAC Audio Encoder add-on for Kodi"
arch=('loong64' 'x86_64')
url='https://github.com/xbmc/audioencoder.flac'
license=('GPL')
groups=('kodi-addons' 'kodi-addons-audioencoder')
makedepends=('cmake' 'kodi-dev')
options=(!lto)
source=("$pkgname-$pkgver.tar.gz::https://github.com/xbmc/audioencoder.flac/archive/$pkgver-$_codename.tar.gz")
sha512sums=('83e3a6cd0311af05c7f3ae456bbe3d5627e47bc5d8f163bdfe57f3e70f798db6e9728698c73b3dc9da6cca2204e6a07004edff012f9bbf2e2b062e3fb97d5338')

build() {
    cd "audioencoder.flac-$pkgver-$_codename"
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=1 \
        -DUSE_LTO=1 \
        .
    make
}

package() {
    depends=('kodi')
    cd "audioencoder.flac-$pkgver-$_codename"
    make DESTDIR="$pkgdir/" install
}

